package com.seres.user.controller.api.oplog;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.seres.annotation.AuthToken;
import com.seres.client.vo.LogReq;
import com.seres.client.vo.LogRes;
import com.seres.response.ApiResponse;
import com.seres.user.service.oplog.ISysLogService;
import com.seres.util.BaseController;
import com.seres.util.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Tan-Bowen
 * @version 1.0
 * @description TODO
 * @date 2021/7/27 14:52
 */

@Api(value = "日志管理", tags = "日志管理")
@Slf4j
@RestController
@RequestMapping("/api/logs")
public class LogsController extends BaseController {
    @Resource
    private ISysLogService logService;

    @AuthToken(checkPower = false,log = false)
    @PostMapping("/page")
    @ApiOperation(value = "日志数据分页")
    public ApiResponse<IPage<LogRes.Pages>> getLogPage(PageUtil.Pages page, LogReq req) {
        return ApiResponse.success(logService.getLogPage( getPage(page),req));
    }


}